package com.wu.flandre.api.admin;

import com.wu.flandre.entity.common.ResponseTemp;
import com.wu.flandre.service.AdminIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * AdminIndexApi <br/>
 *
 * @author xuan.wu <br/>
 * @date 2019/12/29 12:56 <br/>
 */
@RestController
@Scope("prototype")
public class AdminIndexApi {

    @Autowired
    AdminIndexService adminIndexService;

    @GetMapping("/server/info")
    public ResponseTemp serverInfo() {
        return adminIndexService.serverInfo();
    }

    @GetMapping("/server/memory")
    public ResponseTemp serverMemory() {
        return adminIndexService.serverMemory();
    }

    @GetMapping("/server/jvm")
    public ResponseTemp serverJvm() {
        return adminIndexService.serverJvm();
    }

    @GetMapping("server/disk")
    public ResponseTemp serverDisk() {
        return adminIndexService.serverDisk();
    }

    @GetMapping("/server/db")
    public ResponseTemp serverDatabase() {
        return adminIndexService.serverDb();
    }
}
